home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11081 < prev    next >
Encoding:
Text File  |  1996-08-05  |  732 b   |  31 lines

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: mvaccaro1@aol.com (MVaccaro1)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Float to String
  5. Date: 21 Mar 1996 16:18:01 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4ish29$7eq@newsbf02.news.aol.com>
  9. References: <4is29s$h1a@dfw-ixnews6.ix.netcom.com>
  10. Reply-To: mvaccaro1@aol.com (MVaccaro1)
  11. NNTP-Posting-Host: newsbf02.mail.aol.com
  12.  
  13. >Is it possible to convert a float to a string?  like the itoa function.
  14.  
  15. You might want to try sprintf.  
  16.  
  17. main( )
  18.    {
  19.    double x=5.6;
  20.    char str[30];
  21.  
  22.    sprintf( str, "%f", x );  /* convert double x to string */
  23.    .
  24.    .
  25.    .
  26.    }
  27.  
  28. Mike :->
  29.  
  30. Design? What design! - I've too much coding to do...
  31.